package test;

import java.util.Scanner;

public class lvxin {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int s=scan.nextInt();
        long[] a=new long[s+1];
        long[] b=new long[s+1];
        long m=Long.MAX_VALUE;
        for(int i=1;i<=s;i++){
            a[i]=scan.nextLong();
            a[i]+=a[i-1];
        }
        for(int i=1;i<=s;i++){
            b[i]=scan.nextLong();
            b[i]+=b[i-1];
        }
        for(int i=1;i<=s;i++){
            m=Math.min(m,a[s]-a[i]+b[i]);
            m=Math.min(m,b[s]-b[i]+a[i]);

        }
        System.out.println(m);
        scan.close();
    }
}
